import request from '@/utils/request'


export function getList(params) {
  return request({
    url: '/admin/table/list',
    method: 'get',
    params
  })
}



//获取邮箱验证码
export function getCode(username) {
  return request({
    url: '/users/confirm',
    method: 'get',
    params:{username}
  })
}

//获取船只列表
export function getShipList(pageNum,pageSize){
  return request({
    url:'/users/ship/list',
    method: 'get',
    params: { pageNum, pageSize } 
  })
}

// 删除渔船的函数
export function deleteShip(id) {
  return request({
    url: `users/ship/${id}`,
    method: 'get'
  });
}

//注册船只
export function registerShip(data){
  return request({
    url: '/users/ship/register',
    method: 'post',
    data
  })
}

//搜索渔船记录
export function searchShipRecord(params){
  return request({
    url:'users/ship/search-list',
    method:'get',
    params
  })
}

//用户获取捕获记录列表
export function getRecordList(pageNum,pageSize){
  return request({
    url:'/users/record/list',
    method: 'get',
    params: { pageNum, pageSize } 
  })
}

//搜索捕捞记录记录
export function searchRecord(params){
  return request({
    url:'users/record/search-list',
    method:'get',
    params
  })
}

//上报捕捞记录
export function updateRecord(data){
  return request({
    url:'users/record',
    method:'post',
    data
  })
}

// 获取详情页内产品的数量
export function getProduct(id){
  return request({
    url:'/users/record?id='+id,
    method:'get',
  })
}
